package lab01;

public class Test05 {
    public static void main(String[] args) {
        int sum1=0;
        //for循环求和
        for (int i=0;i<=100;i++){
            sum1+=i;
        }
        System.out.println("sum:"+sum1);
        //while 求和
        int j=0;
        int sum2=0;
        while(j<=100){
        sum2+=j;
        j++;
        }
        System.out.println("while:"+sum2);
        //do while 求和
        int z=0;
        int sum3=0;
        do {
            sum3+=z;
            z++;
        }while(z<=100);
        System.out.println("do while:"+sum3);
    }
}
